import request from "@/utils/request";

// 获取数据列表（分页）
export function myExamList(data) {
  return request({
    url: "/api/exam/TemsExam/myExamList",
    method: "post",
    data: {
      sort: "desc",
      sidx:'',
      ...data,
    },
  });
}

// 获取数据列表（分页）- 新
export function myExamListNew(data) {
  return request({
    url: "/api/exam/TemsExam/getList",
    method: "post",
    data: {
      sort: "desc",
      sidx:'',
      ...data,
    },
  });
}

// 获取数据列表（分页）- 新
export function myExamListTask(data) {
  return request({
    url: "/api/exam/TemsExamTask/getList",
    method: "post",
    data: {
      sort: "desc",
      sidx:'',
      ...data,
    },
  });
}

export function getMySubjectList(data) {
  return request({
    url: "/api/course/TemsSubject/getMySubjectList",
    method: "post",
    data:{
      sort: "desc",
      sidx:'',
      ...data,
    },
  });
}

export function getExamTaskDetail(id) {
  return request({
    url: "/api/exam/TemsExam/myExam/"+id,
    method: "get",
  });
}

export function getExamDetail(id) {
  return request({
    url: "/api/exam/TemsExam/ExamDetail/"+id,
    method: "post",
  });
}

export function TemsCourseStudy(id,process) {
  return request({
    url: "/api/course/TemsCourse/study/"+id,
    method: "post",
    data:{
      process
    }
  });
}

export function studySubject(id) {
  return request({
    url: "/api/course/TemsSubject/studySubject/"+id,
    method: "post",
  });
}

export function startExamTask(id) {
  return request({
    url: "/api/exam/TemsExam/startExam/"+id,
    method: "post",
    data:{
      courseId:''
    }
  });
}
export function submitExamTask(id,data) {
  return request({
    url: "/api/exam/TemsExamTask/submit/"+id,
    method: "put",
    data: data
  });
}

// 查看解析
export function analysisExamTask(id) {
  return request({
    url: `/api/exam/TemsExamTask/${id}`,
    method: "get",
    data: {
      id
    }
  });
}

// 专题列表
export function getScopeList(data) {
  return request({
    url: "/api/course/TemsSubject/getScopeList",
    method: "post",
    data: {
      sort: "desc",
      sidx: "",
      ...data,
    },
  });
}

export function getSubjectDetail(id) {
  return request({
    url: "/api/course/TemsSubject/detail/"+id,
  });
}

export function getTemsCourseDetail(id){
  return request({
    url: "/api/course/TemsCourse/detail/"+id,
  });
}

// 证书获取提交
export function temsCertUserSimple(data) {
  return request({
    url: "/api/course/TemsCertUserSimple",
    method: "post",
    data
  });
}

// 查询证书信息
export function certRecordInfo(resourceId) {
  return request({
		url: `/api/course/TemsCertUserSimple/getByReourceId/${resourceId}`,
		method: "get",
		data: {
			resourceId
		}
	})
}

// 收件人列表
export function getTemsCertUserNameList(data) {
  return request({
    url: "/api/course/TemsCertUserSimple/getList",
    method: "post",
    data
  });
}

// 证书列表
export function getTemsCertUserSimpleList(data) {
  return request({
    url: "/api/course/TemsCertUserSimple/getMyCertList",
    method: "post",
    data
  });
}

// 所有的证书列表
export function getTemsCertUserSimpleAllList(data) {
  return request({
    url: "/api/course/TemsCertUserSimple/getList",
    method: "post",
    data
  });
}

// 发放
export function batchRemove(ids) {
  return request({
    url: "/api/course/TemsCertUserSimple/batchRemove/"+ids,
    method: "put"
  });
}

// 考试报名接口
export function updateByBaoMingId(id) {
  return request({
    url: `/api/exam/TemsExamUser/updateByBaoMing/${id}`,
    method: "put"
  });
}